
define(['vue','moment','config','common'],function(Vue,moment,config,utils){
	'use strict';

	var bulletinDetailView=new Vue({
		el:'#app',
		data:{
			messageTitle:'',
			messageContent:'',
			pushTime:''

		},
		filters: {
		  moment: function (date) {
		    return moment(date).format('YYYY-MM-DD');
		  } 
		 
		},
		created:function(){
			var _this = this;
			var msgId = utils.getQueryVariable('messageId');
			var formData = new FormData();
			formData.append('id',msgId)
			$.ajax({
		        type:"POST",
		        url: utils.getWebUrl('message/get'),
		        data: formData,
		        headers: {
	            	'authorization': 'Bearer '+utils.userToken()
	            },
		        async: true,
		        processData: false,
		        contentType: false,
		        xhrFields: {withCredentials: true},
	            crossDomain: true,
	            beforeSend:function(){
                	$('.DataLoading').show();
                },
                complete:function(){
                	$('.DataLoading').hide();
                },
		        success:function(res){
		           	if(res.code === "10000"){
		           		_this.messageTitle = res.data.messageTitle;
						_this.messageContent = res.data.messageContent;
						_this.pushTime = moment(res.data.pushTime*1000).format('YYYY-MM-DD hh:mm:ss');
		           	}else{
		           		utils.appAlert(res.msg)
		           	}
		        },
		        error: function(res){
                    utils.appAlert('网络异常');
                }
		    });	
		},
		methods:{

		}
	})

	return bulletinDetailView
});